﻿namespace UnityEditor
{
    using System;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using UnityEditorInternal;
    using UnityEngine;

    public sealed class Unsupported
    {
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void CaptureScreenshotImmediate(string filePath, int x, int y, int width, int height);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern bool CheckIPhoneXCode4Installed();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern bool CheckIPhoneXCodeInstalled();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void CopyGameObjectsToPasteboard();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        internal static extern void CopyStateMachineToPasteboard(UnityEngine.Object obj);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        internal static extern void CopyStateToPasteboard(UnityEngine.Object obj);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void DeleteGameObjectSelection();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void DuplicateGameObjectsUsingPasteboard();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern bool GetApplicationSettingCompressAssetsOnImport();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern string GetBaseUnityDeveloperFolder();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern int GetLocalIdentifierInFile(int instanceID);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        internal static extern NETVersion GetNETVersion();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern UnityEngine.Object GetSerializedAssetInterfaceSingleton(string className);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern string[] GetSubmenus(string menuPath);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern string[] GetSubmenusCommands(string menuPath);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern System.Type GetTypeFromFullName(string fullName);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        internal static extern bool HasStateMachineDataInPasteboard();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        private static extern Vector3 INTERNAL_CALL_MakeNiceVector3(ref Vector3 vector);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern bool IsBleedingEdgeBuild();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern bool IsDestroyScriptableObject(ScriptableObject target);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern bool IsDeveloperBuild();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern bool IsNativeCodeBuiltInReleaseMode();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void LaunchIPhoneXCode4();
        internal static Vector3 MakeNiceVector3(Vector3 vector)
        {
            return INTERNAL_CALL_MakeNiceVector3(ref vector);
        }

        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void PasteGameObjectsFromPasteboard();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        internal static extern void PasteToStateMachineFromPasteboard(StateMachine sm, StateMachine rootStateMachine);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void PrepareObjectContextMenu(UnityEngine.Object c, int contextUserData);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern string ResolveSymlinks(string path);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void SceneTrackerFlushDirty();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void SetAllowCursorHide(bool allow);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void SetAllowCursorLock(bool allow);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void SetApplicationSettingCompressAssetsOnImport(bool value);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void SetQualitySettingsShadowDistanceTemporarily(float distance);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void SetRenderSettingsUseFogNoDirty(bool fog);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void SmartReset(UnityEngine.Object obj);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void StopPlayingImmediately();
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern bool StripFatMacho(string path, bool generatePPC);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public static extern void TerminateIPhoneXCode4();

        [StructLayout(LayoutKind.Sequential)]
        public struct ProgressiveMesh
        {
            internal int opaquePtr;
            public static void Create(Mesh src, out Unsupported.ProgressiveMesh pm)
            {
                pm.opaquePtr = CreateImpl(src);
            }

            public static void Destroy(ref Unsupported.ProgressiveMesh pm)
            {
                DestroyImpl(pm.opaquePtr);
                pm.opaquePtr = 0;
            }

            public static void CreateInitialGeometry(Unsupported.ProgressiveMesh pm, Mesh mesh)
            {
                CreateInitialGeometryImpl(pm.opaquePtr, mesh);
            }

            public static void UpdateMesh(Unsupported.ProgressiveMesh pm, int targetTriCount, Mesh mesh)
            {
                UpdateMeshImpl(pm.opaquePtr, targetTriCount, mesh);
            }

            [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
            internal static extern int CreateImpl(Mesh src);
            [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
            internal static extern void DestroyImpl(int pmOpaque);
            [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
            internal static extern void CreateInitialGeometryImpl(int pmOpaque, Mesh target);
            [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
            internal static extern void UpdateMeshImpl(int pmOpaque, int targetTriCount, Mesh target);
        }
    }
}

